/*
 * RoundRobinScheduler.h
 *
 *  Created on: 29-11-2013
 *      Author: Tomasz Lis
 */

#ifndef ROUNDROBINSCHEDULER_H_
#define ROUNDROBINSCHEDULER_H_

#include <csimplemodule.h>
#include <vector>
#include <packet_m.h>
#include <fstream>
using namespace std;

class RoundRobinScheduler: public cSimpleModule {
public:
    simtime_t lastArrival;
    simtime_t delay;

    int numberOfDeletedMinPrior;
    int numberOfDeletedMaxPrior;
    int numberOfDeleted;
    int numberOfForward;

    vector<int> idsList;
    vector<vector<Packet*>*> queuesList;

    cMessage* sendTrigger;
    unsigned int queueSize;
    unsigned int currentQueue;
    RoundRobinScheduler();
    virtual ~RoundRobinScheduler();

    void initialize();
    void handleMessage(cMessage* msg);
    bool receivePacket(Packet* packet);
    int getId(int src);
    bool isWaitingPacket();
    Packet* getPacket();
    virtual void finish();
};
Define_Module(RoundRobinScheduler);
#endif /* ROUNDROBINSCHEDULER_H_ */
